﻿using Domain.Models;
using GraphQL.Types;
using Utilities.Entity;

namespace GraphQLDomain.Types
{
    public class UserType : ObjectGraphType<Account>
    {
        public UserType()
        {
            Name = "User";
            Field(u => u.Id).Description(EntityHelper.GetFiledDescription<Account>("Id"));
            Field(u => u.NickName).Description(EntityHelper.GetFiledDescription<Account>("NickName"));
            Field(u => u.CreateBy).Description(EntityHelper.GetFiledDescription<Account>("CreateBy"));
            Field(u => u.CreateTime, nullable: true).Description(EntityHelper.GetFiledDescription<Account>("CreateTime"));
            Field(u => u.UserName).Description(EntityHelper.GetFiledDescription<Account>("Account"));
            Field(u => u.UpdateBy).Description(EntityHelper.GetFiledDescription<Account>("UpdateBy"));
            Field(u => u.UpdateTime, nullable: true).Description(EntityHelper.GetFiledDescription<Account>("UpdateTime"));
            Interface<BaseEntityInterface>();
        }
    }
}
